package com.qf.dao;

import com.qf.pojo.Menu;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Set;

public interface MenuDao {
    @Select("SELECT DISTINCT m.perms FROM sys_role r LEFT " +
            "JOIN sys_user_role ur ON r.`id`=ur.r_id LEFT" +
            "JOIN sys_users u ON u.`id`=ur.`u_id` LEFT" +
            "JOIN sys_role_menu rm ON rm.r_id=r.`id` LEFT" +
            "JOIN sys_menu m ON m.id =rm.m_id" +
            "WHERE u.id=#{uid}")
    Set<String> findMenuByUid(@Param("uid") Integer uid);
}
